<?php
/* @var $this CatalogItemController */
/* @var $data CatalogItem */
?>

<div class="view row">

	<div class="large-2 medium-2 columns">
		<?php echo '<img src="'.$data->pictures[0]->url.'" />'; ?>
	</div>

	<div class="large-10 medium-10 columns">
		#<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>#
		<?php echo CHtml::link(CHtml::encode($data->title), array('view', 'id'=>$data->id)); ?>
		<br />

		<?php echo CHtml::encode($data->description); ?>
		<br />

		<?php echo CHtml::encode($data->getAttributeLabel('code')); ?>:
		<?php echo CHtml::encode($data->code); ?>
		<br />

		<b>Status:</b>
		<?php echo CHtml::encode($data->getAttributeLabel('type')); ?>:
		<?php if($data->type == ConstProductType::CatalogItem){echo 'Product';}else{echo 'News';} ?>;

		<?php echo CHtml::encode($data->getAttributeLabel('state')); ?>:
		<?php if($data->state == ConstProductState::Draft){echo 'Draft';}else{echo 'Publicated';} ?>;

		<?php echo CHtml::encode($data->getAttributeLabel('view_count')); ?>:
		<?php echo CHtml::encode($data->view_count); ?>;

		<?php echo CHtml::encode($data->getAttributeLabel('user')); ?>:
		<?php echo CHtml::encode($data->user->username); ?>;

		<?php echo CHtml::encode($data->getAttributeLabel('catalog')); ?>:
		<?php if($data->catalog){ echo CHtml::encode($data->catalog->title);}else{echo 'Common';} ?>.
		<br />
	</div>

</div>